package com.example.demo.serviceimpl;

import com.example.demo.dao.MessageMapper;
import com.example.demo.dao.UserMapper;
import com.example.demo.pojo.MessageEntity;
import com.example.demo.pojo.UserEntity;
import com.example.demo.service.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    MessageMapper message ;

    @Autowired
    UserMapper use;
    @Override
    public int register(UserEntity user) {
            return  use.insert(user);
    }

    @Override
    public int updateById(UserEntity entity) {
        return  use.updateById(entity);
    }

    @Override
    public int insertMessage(MessageEntity entity) {
        return message.insert(entity);
    }
    @Override
    public   List<UserEntity> check (String  username ,String password){

        return use.check(username,password);



    }
}
